package day13;
/**
 * InstanceCounter类的测试类
 * 用于验证实例计数功能是否正常工作
 */
public class InstanceCounterTest {
    /**
     * 测试实例计数功能
     * @param args 命令行参数
     */
    public static void main(String[] args) {
        // 初始状态下，实例数量应该为0
        System.out.println("初始实例数量: " + InstanceCounter.getInstanceCount());
        
        // 创建第一个实例
        InstanceCounter obj1 = new InstanceCounter();
        System.out.println("创建第一个实例后数量: " + InstanceCounter.getInstanceCount());
        
        // 创建第二个实例
        InstanceCounter obj2 = new InstanceCounter();
        System.out.println("创建第二个实例后数量: " + InstanceCounter.getInstanceCount());
        
        // 创建第三个实例
        InstanceCounter obj3 = new InstanceCounter();
        System.out.println("创建第三个实例后数量: " + InstanceCounter.getInstanceCount());
        
        // 创建更多实例
        InstanceCounter obj4 = new InstanceCounter();
        InstanceCounter obj5 = new InstanceCounter();
        System.out.println("创建5个实例后总数量: " + InstanceCounter.getInstanceCount());
    }
}